package OBSXML;

import java.util.ArrayList;

/**
 * Konfigurationslæser til MailServer
 * 
 * @author Børge Bergstrøm
 */
public class MailServerConf extends XML{
    
    private String mailHost, mailProtocol, mailUsername, mailPassword, mailFromEmail, mailFromName = null;
    private int mailPort = 0;
    private ArrayList<String> dbConfFileReader = ReadXMLFile();

    /**
     * Indlæser konfigurationsfilen ud fra parameter.
     *
     * @param path
     * @param XMLFileName
     */
    public MailServerConf(String path, String XMLFileName)
    {
        super(path, XMLFileName);
        mailHost = dbConfFileReader.get(0);
        mailPort = Integer.parseInt(dbConfFileReader.get(1));
        mailProtocol = dbConfFileReader.get(2);
        mailUsername = dbConfFileReader.get(3);
        mailPassword = dbConfFileReader.get(4);
        mailFromEmail = dbConfFileReader.get(5);
        mailFromName = dbConfFileReader.get(6);
    }

    /**
     * Henter Mail host
     *
     * @return String
     */
    public String getMailHost()
    {
        return mailHost;
    }

    /**
     * Hent mail portnummer
     *
     * @return int
     */
    public int getMailPort()
    {
        return mailPort;
    }

    /**
     * Hent mail protokol
     *
     * @return String
     */
    public String getMailProtocol()
    {
        return mailProtocol;
    }

    /**
     * Hent mail loginnavn
     * 
     * @return String
     */
    public String getMailUsername()
    {
        return mailUsername;
    }

    /**
     * Hent loginpassword
     * 
     * @return String
     */
    public String getMailPassword()
    {
        return mailPassword;
    }

    /**
     * Hent mail afsender
     * 
     * @return
     */
    public String getMailFromEmail()
    {
        return mailFromEmail;
    }

    /**
     * Hent navn for afsender
     * 
     * @return
     */
    public String getMailFromName()
    {
        return mailFromName;
    }
}
